package com.akk.action;

import com.akk.business.AvsHlbH5Business;
import com.akk.module.hlbpay.model.HlbH5CallBackRequest;
import com.akk.utils.RestResponse;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by admin on 2017/11/11.
 * 合利宝H5
 */
@RestController
@RequestMapping("/thmlfApi/avs/hlbh5")
public class AvsHlbH5Action {

    @Autowired
    private AvsHlbH5Business hlbH5Business;

    @GetMapping(value = "/quickpay")
    @ApiOperation(value = "合利宝H5快捷",notes = "H5快捷收款",httpMethod = "GET",response = RestResponse.class)
    public RestResponse h5QuickPay(String accessBindId,String orderId,HttpServletRequest servletRequest){
        return hlbH5Business.h5QuickPay(accessBindId,orderId,servletRequest);
    }

    @PostMapping(value = "/quickpaycallback")
    @ApiOperation(value = "合利宝H5支付回调",notes = "支付回调方法",httpMethod = "POST",response = String.class)
    public String quickPayCallBack(String appId, String payerId, HttpServletRequest request, HttpServletResponse response){
        return hlbH5Business.quickPayCallBack(appId,payerId,request,response);
    }

    @PostMapping(value = "/quickpayservercallback")
    @ApiOperation(value = "合利宝H5支付通知",notes = "支付结果通知方法",httpMethod = "POST",response = String.class)
    public String quickPayServerCallBack(HlbH5CallBackRequest request){
        return hlbH5Business.quickPayServerCallBack(request);
    }


}
